<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <el-form :model="form" :rules="rules" ref="form" label-width="100px">
            <el-form-item label="活动名称" prop="username">
                <el-input v-model="form. username"> </el-input>
            </el-form-item>
        </el-form>
    </div>
    <script src="./vue.js"> </script>
    <script src="./ele.js"> </script>
    <script src="./element.css"> </script>

    <script>
        new Vue({
            el: "#app",
            data() {
                return {
                    form: {
                        username: "",
                    },
                    rules: {
                        username: [
                            { required: true, message: '请输入活动名称', trigger: 'change' },
                            { min: 3, max: 5, message: '长度在3到5个字符', trigger: 'change' }
                        ]
                    }

                }
            },

        },

        })
    </script>
</body>

</html>